1. Field of the Invention
The present invention relates to server computer systems and databases. More specifically, the present invention relates to a method and an apparatus for accessing static metadata located within a memory within a server through a static metadata object so that the server does not have to access a database in order to retrieve the static metadata.
2. Related Art
The rise of the Internet and the world wide web is dramatically changing the way in which computational tasks are performed. Under the previous client-server model, xe2x80x9cfat clientxe2x80x9d computing systems would request services from server computer systems. These fat client computing systems typically performed much of the computational work involved in executing an application, and would typically make relatively minor demands on a server computer system for data storage and/or computational resources.
In the current web-based computing model, web browsers on client computing systems make demands on web servers located on server computer systems. These web browsers act as xe2x80x9cthin clients,xe2x80x9d because they typically perform only limited amounts of computation locally on the client computer system. Web browsers instead rely on web servers and middle layers to perform most of the computational work involved in executing an application.
This web-based computing model can place a tremendous load on server computing systems because they are often interacting within large numbers of browsers at any given time. In fact, some web sites receive more than 1,000,000 hits on web pages each day. This means that thousands of browsers can potentially be interacting with a web site at the same time.
With so many browser sessions active at the same time, it is impractical for a server computer system to maintain a significant amount of information in the memory for each of the browser sessions. One solution to this problem is to store all static data about a browser session in a database, and to retrieve the static data from the database when necessary. This reduces the memory requirements for the server computer system, but also creates additional database accesses, which can greatly reduce system performance. For example, an access to a data item in the database may require a first database access to retrieve static metadata describing the structure of the data to be accessed, and then a second database access to retrieve the data itself.
Hence, what is needed is a method and an apparatus that allows a server to store metadata for client sessions in the memory of the server without storing a large amount of data for each client session.
One embodiment of the present invention provides a system that retrieves metadata from a memory within a server, so that the server does not have to access a database in order to retrieve the metadata. The system operates by receiving a request from a client, which causes an operation to be performed on data within the database. In response to the request, the system retrieves the metadata through a metadata object, which retrieves the metadata from a random access memory in the server. Note that this metadata specifies how the data is stored within the database. The system then performs the operation on the data within the database by using the metadata to determine how the data is stored within the database. Note that this metadata object can be used to service requests from a plurality of clients. Hence, client sessions can share the same metadata, which can greatly reduce the amount of memory used by client sessions.
In one embodiment of the present invention, the system includes a service that automatically loads metadata into random access memory.
In one embodiment of the present invention, if the metadata is not located within the random access memory in the server, the system retrieves the metadata from the database.
In one embodiment of the present invention, the metadata object contains static metadata specifying how tables and views are organized within the database.
In one embodiment of the present invention, the system accesses the metadata object through a generic object on the server.
In one embodiment of the present invention, the operation on the database includes one of, writing the data to the database, reading the data from the database, and creating an entry in the database.
In one embodiment of the present invention, the metadata object is implemented as an object adhering to the common object model (COM) standard.
In one embodiment of the present invention, the request is received from a browser on the client at a web site on the server.
In one embodiment of the present invention, the system uses the metadata to render a form for accepting input from a user.